words = input().split(',')
s = input()
str = ""
for i in words:
    for j in i:
        str += j
        break

if s == str:
    print('true')
else:
    print('false')

